using Core;

namespace Server;

[PlayCommand(CommandKey.Login)]
public sealed class UserLogin : PlayRespAsyncCommand<LoginPacket, LoginRespPacket>
{
    protected override ValueTask<LoginRespPacket> ExecuteAsync(PlaySession session, LoginPacket packet)
    {
        session.UserId = 20424666;
        
        return ValueTask.FromResult(new LoginRespPacket
        {
            SuccessFul = true,
            Id = 20422666,
            Identifier = packet.Identifier,
            Token = Guid.NewGuid().ToString("N")
        });
    }
}